<template>
  <div>
    <custom-card title="电器件" class="mt-30">
      <el-table :data="electronicsList" border fit highlight-current-row style="width: 100%">
        <el-table-column align="center" label="名称" prop="nameCn"></el-table-column>
        <el-table-column align="center" label="规格" prop="standard"></el-table-column>
        <el-table-column align="center" label="厂商" prop="manufacturer"></el-table-column>
        <el-table-column align="center" label="认证" prop="cert"></el-table-column>
      </el-table>
    </custom-card>
    <custom-card title="结构件" class="mt-30">
      <el-table :data="structuresList" border fit highlight-current-row style="width: 100%">
        <el-table-column align="center" label="名称" prop="nameCn"></el-table-column>
        <el-table-column align="center" label="规格" prop="standard"></el-table-column>
        <el-table-column align="center" label="厂商" prop="manufacturer"></el-table-column>
        <el-table-column align="center" label="认证" prop="cert"></el-table-column>
      </el-table>
    </custom-card>
    <custom-card title="控制要点" class="mt-30">
      <el-table :data="controlPointsList" border fit highlight-current-row style="width: 100%">
        <el-table-column align="center" label="名称" prop="nameCn"></el-table-column>
        <el-table-column align="center" label="规格" prop="standard"></el-table-column>
        <el-table-column align="center" label="厂商" prop="manufacturer"></el-table-column>
        <el-table-column align="center" label="认证" prop="cert"></el-table-column>
      </el-table>
    </custom-card>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex';
  import CustomCard from '@/components/CustomCard/index';
  import * as api from '@/api/sale/model/index';

  export default {
    name: 'DetailPbs',
    components: {
      CustomCard
    },
    props: {
      modelPbsId: {
        type: String,
        default: ''
      }
    },
    data() {
      return {
        electronicsList: [],
        structuresList: [],
        controlPointsList: []
      };
    },
    computed: {
      ...mapGetters(['elements', 'language', 'dict'])
    },
    created() {
      this.init()
    },
    activated() {
      this.init();
    },
    methods: {
      init() {
        api.getFilePcc({
          articleId: this.$route.query.modelPbsId
        }).then(res => {
          console.log(res)
          this.electronicsList = res.data.electronicsList
          this.structuresList = res.data.structuresList
          this.controlPointsList = res.data.controlPointsList
        });
      }
    }
  };
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
</style>
